<template>
  自定义指令:
  <input type="text" v-focus:foo.bar="'baz'" />
  <span> {{ name }}</span>
  <input type="text" v-focus>
  <my-foo />
</template>

<script setup>
import { inject } from 'vue';
import myFoo from "./components/myFoo.vue";

const name = inject('name')
const vFocus = (el, binding) => {
  console.log(el, binding);
  el.focus();
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
